home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1991-02-11 | 7.0 KB | [TEXT/????] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: tftp.h
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
10%
| dexvert
| Jesper Olsen Module (music/jesperOlsen)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Mon Feb 11 21:10:40 1991, modified Mon Feb 11 21:10:40 1991, creator '????', type ASCII, 6550 bytes "tftp.h" , at 0x1a16 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
49%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
33%
| TrID
| TTComp archive compressed (bin-4K)
| default (weak)
| |
16%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [????] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 74 66 74 70 2e 68 | 00 00 00 00 00 00 00 00 |..tftp.h|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 3f 3f 3f | 3f 00 00 00 00 00 00 00 |.TEXT???|?.......|
|00000050| 00 00 00 00 00 19 96 00 | 00 01 7e a3 dc ff 20 a3 |........|..~... .|
|00000060| dc ff 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 d2 d2 00 00 |........|........|
|00000080| 2f 2a 20 20 43 6f 70 79 | 72 69 67 68 74 20 31 39 |/* Copy|right 19|
|00000090| 38 34 20 62 79 20 74 68 | 65 20 4d 61 73 73 61 63 |84 by th|e Massac|
|000000a0| 68 75 73 65 74 74 73 20 | 49 6e 73 74 69 74 75 74 |husetts |Institut|
|000000b0| 65 20 6f 66 20 54 65 63 | 68 6e 6f 6c 6f 67 79 20 |e of Tec|hnology |
|000000c0| 20 2a 2f 0d 0d 2f 2a 0d | 09 43 6f 70 79 72 69 67 | */../*.|.Copyrig|
|000000d0| 68 74 20 43 6f 72 6e 65 | 6c 6c 20 55 6e 69 76 65 |ht Corne|ll Unive|
|000000e0| 72 73 69 74 79 20 31 39 | 38 36 2e 20 20 41 6c 6c |rsity 19|86. All|
|000000f0| 20 72 69 67 68 74 73 20 | 61 72 65 20 72 65 73 65 | rights |are rese|
|00000100| 72 76 65 64 2e 0d 0d 09 | 41 73 20 6f 66 20 34 2f |rved....|As of 4/|
|00000110| 31 30 2f 38 36 3a 0d 09 | 54 68 69 73 20 73 6f 75 |10/86:..|This sou|
|00000120| 72 63 65 20 66 69 6c 65 | 20 6d 61 79 20 68 61 76 |rce file| may hav|
|00000130| 65 20 6e 6f 20 63 68 61 | 6e 67 65 73 20 66 72 6f |e no cha|nges fro|
|00000140| 6d 20 74 68 65 20 4d 2e | 49 2e 54 20 6f 72 69 67 |m the M.|I.T orig|
|00000150| 69 6e 61 6c 0d 09 6f 74 | 68 65 72 20 74 68 61 6e |inal..ot|her than|
|00000160| 20 74 68 69 73 20 6e 6f | 74 69 63 65 3b 20 62 75 | this no|tice; bu|
|00000170| 74 20 69 74 20 68 61 73 | 20 62 65 65 6e 20 74 65 |t it has| been te|
|00000180| 73 74 65 64 20 61 73 20 | 70 61 72 74 20 6f 66 20 |sted as |part of |
|00000190| 0d 09 43 6f 72 6e 65 6c | 6c 27 73 20 41 7a 74 65 |..Cornel|l's Azte|
|000001a0| 63 2d 43 20 70 6f 72 74 | 2e 20 20 53 65 65 20 6e |c-C port|. See n|
|000001b0| 6f 74 69 63 65 2e 68 0d | 0d 2a 2f 0d 0d 2f 2a 20 |otice.h.|.*/../* |
|000001c0| 20 53 65 65 20 70 65 72 | 6d 69 73 73 69 6f 6e 20 | See per|mission |
|000001d0| 61 6e 64 20 64 69 73 63 | 6c 61 69 6d 65 72 20 6e |and disc|laimer n|
|000001e0| 6f 74 69 63 65 20 69 6e | 20 66 69 6c 65 20 22 6e |otice in| file "n|
|000001f0| 6f 74 69 63 65 2e 68 22 | 20 20 2a 2f 0d 23 69 6e |otice.h"| */.#in|
|00000200| 63 6c 75 64 65 09 3c 6e | 6f 74 69 63 65 2e 68 3e |clude.<n|otice.h>|
|00000210| 0d 0d 2f 2a 20 31 30 2f | 31 2f 38 34 20 2d 20 61 |../* 10/|1/84 - a|
|00000220| 64 64 65 64 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 |dded def|inition |
|00000230| 6f 66 20 64 6f 73 5f 65 | 6f 66 20 61 73 20 63 6f |of dos_e|of as co|
|00000240| 6e 74 72 6f 6c 20 5a 20 | 73 69 6e 63 65 20 3c 73 |ntrol Z |since <s|
|00000250| 74 64 69 6f 2e 68 3e 0d | 09 6e 6f 20 6c 6f 6e 67 |tdio.h>.|.no long|
|00000260| 65 72 20 64 65 66 69 6e | 65 73 20 69 74 2e 09 09 |er defin|es it...|
|00000270| 09 3c 4a 6f 68 6e 20 52 | 6f 6d 6b 65 79 3e 0d 20 |.<John R|omkey>. |
|00000280| 20 20 31 31 2f 32 39 2f | 38 34 20 2d 20 63 68 61 | 11/29/|84 - cha|
|00000290| 6e 67 65 64 20 72 6f 75 | 6e 64 2d 74 72 69 70 20 |nged rou|nd-trip |
|000002a0| 74 69 6d 65 20 69 6e 69 | 74 69 61 6c 20 65 73 74 |time ini|tial est|
|000002b0| 69 6d 61 74 65 20 74 6f | 20 32 2e 35 20 73 65 63 |imate to| 2.5 sec|
|000002c0| 0d 20 20 20 20 20 20 20 | 20 74 6f 20 61 63 63 6f |. | to acco|
|000002d0| 6d 6f 64 61 74 65 20 6f | 76 65 72 6c 6f 61 64 65 |modate o|verloade|
|000002e0| 64 20 56 41 58 20 75 6e | 69 78 20 73 79 73 74 65 |d VAX un|ix syste|
|000002f0| 6d 73 2e 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ms.. | |
|00000300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000310| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000320| 20 20 20 20 20 3c 4a 2e | 20 48 2e 20 53 61 6c 74 | <J.| H. Salt|
|00000330| 7a 65 72 3e 20 20 0d 09 | 32 2f 32 38 2f 38 37 20 |zer> ..|2/28/87 |
|00000340| 6b 65 76 69 6e 20 63 68 | 61 6e 67 65 64 20 74 69 |kevin ch|anged ti|
|00000350| 6d 65 6f 75 74 20 74 69 | 6d 65 73 20 74 6f 20 72 |meout ti|mes to r|
|00000360| 65 66 6c 65 63 74 20 36 | 30 2f 74 69 63 6b 73 20 |eflect 6|0/ticks |
|00000370| 73 65 63 6f 6e 64 20 6f | 6e 20 74 68 65 20 4d 61 |second o|n the Ma|
|00000380| 63 2e 0d 09 31 30 2f 32 | 39 2f 38 37 20 6b 65 76 |c...10/2|9/87 kev|
|00000390| 69 6e 20 6d 61 64 65 20 | 74 66 6b 69 6c 6c 28 29 |in made |tfkill()|
|000003a0| 20 61 20 66 75 6e 63 74 | 69 6f 6e 20 0d 2a 2f 0d | a funct|ion .*/.|
|000003b0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 69 6f |.#includ|e <stdio|
|000003c0| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 71 2e |.h>.#inc|lude <q.|
|000003d0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 74 69 6d |h>.#incl|ude <tim|
|000003e0| 65 72 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |er.h>.#i|nclude <|
|000003f0| 4d 61 63 54 43 50 43 6f | 6d 6d 6f 6e 54 79 70 65 |MacTCPCo|mmonType|
|00000400| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 55 |s.h>.#in|clude <U|
|00000410| 44 50 50 42 2e 68 3e 0d | 0d 2f 2a 20 54 46 54 50 |DPPB.h>.|./* TFTP|
|00000420| 20 68 65 61 64 65 72 20 | 66 69 6c 65 20 63 6f 6e | header |file con|
|00000430| 74 61 69 6e 73 20 73 74 | 72 75 63 74 75 72 65 73 |tains st|ructures|
|00000440| 20 6f 66 20 54 46 54 50 | 20 70 61 63 6b 65 74 20 | of TFTP| packet |
|00000450| 68 65 61 64 65 72 73 20 | 61 6e 64 20 73 75 63 68 |headers |and such|
|00000460| 2e 20 2a 2f 0d 0d 2f 2a | 20 72 65 61 64 20 6f 72 |. */../*| read or|
|00000470| 20 77 72 69 74 65 20 72 | 65 71 75 65 73 74 20 70 | write r|equest p|
|00000480| 61 63 6b 65 74 20 2a 2f | 0d 73 74 72 75 63 74 20 |acket */|.struct |
|00000490| 74 66 72 65 71 20 7b 0d | 09 75 6e 73 69 67 6e 65 |tfreq {.|.unsigne|
|000004a0| 64 09 74 66 5f 6f 70 3b | 09 09 2f 2a 20 77 6f 75 |d.tf_op;|../* wou|
|000004b0| 6c 64 20 62 65 20 31 20 | 28 72 65 61 64 29 20 6f |ld be 1 |(read) o|
|000004c0| 72 20 32 20 28 77 72 69 | 74 65 29 20 2a 2f 0d 09 |r 2 (wri|te) */..|
|000004d0| 63 68 61 72 09 09 74 66 | 5f 6e 61 6d 65 5b 32 30 |char..tf|_name[20|
|000004e0| 5d 3b 0d 7d 3b 0d 0d 2f | 2a 20 64 61 74 61 20 70 |];.};../|* data p|
|000004f0| 61 63 6b 65 74 20 2a 2f | 0d 73 74 72 75 63 74 20 |acket */|.struct |
|00000500| 74 66 64 61 74 61 20 7b | 0d 09 75 6e 73 69 67 6e |tfdata {|..unsign|
|00000510| 65 64 09 74 66 5f 6f 70 | 3b 09 09 2f 2a 20 77 6f |ed.tf_op|;../* wo|
|00000520| 75 6c 64 20 62 65 20 33 | 20 2a 2f 0d 09 75 6e 73 |uld be 3| */..uns|
|00000530| 69 67 6e 65 64 09 74 66 | 5f 62 6c 6f 63 6b 3b 0d |igned.tf|_block;.|
|00000540| 09 63 68 61 72 09 09 74 | 66 5f 64 61 74 61 5b 35 |.char..t|f_data[5|
|00000550| 31 32 5d 3b 0d 7d 3b 0d | 0d 2f 2a 20 73 74 72 75 |12];.};.|./* stru|
|00000560| 63 74 75 72 65 20 6f 66 | 20 61 6e 20 61 63 6b 20 |cture of| an ack |
|00000570| 70 61 63 6b 65 74 20 2a | 2f 0d 73 74 72 75 63 74 |packet *|/.struct|
|00000580| 09 74 66 61 63 6b 20 7b | 0d 09 75 6e 73 69 67 6e |.tfack {|..unsign|
|00000590| 65 64 09 74 66 5f 6f 70 | 3b 09 09 2f 2a 20 77 6f |ed.tf_op|;../* wo|
|000005a0| 75 6c 64 20 62 65 20 34 | 20 2a 2f 0d 09 75 6e 73 |uld be 4| */..uns|
|000005b0| 69 67 6e 65 64 09 74 66 | 5f 62 6c 6f 63 6b 3b 0d |igned.tf|_block;.|
|000005c0| 7d 3b 0d 0d 2f 2a 20 65 | 72 72 6f 72 20 70 61 63 |};../* e|rror pac|
|000005d0| 6b 65 74 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 54 |ket */.#|define T|
|000005e0| 46 45 52 52 4c 45 4e 09 | 38 30 0d 73 74 72 75 63 |FERRLEN.|80.struc|
|000005f0| 74 20 74 66 65 72 72 20 | 7b 0d 09 75 6e 73 69 67 |t tferr |{..unsig|
|00000600| 6e 65 64 09 74 66 5f 6f | 70 3b 09 09 2f 2a 20 77 |ned.tf_o|p;../* w|
|00000610| 6f 75 6c 64 20 62 65 20 | 35 20 2a 2f 0d 09 75 6e |ould be |5 */..un|
|00000620| 73 69 67 6e 65 64 20 09 | 74 66 5f 63 6f 64 65 3b |signed .|tf_code;|
|00000630| 0d 09 63 68 61 72 09 09 | 74 66 5f 65 72 72 5b 54 |..char..|tf_err[T|
|00000640| 46 45 52 52 4c 45 4e 5d | 3b 20 0d 7d 3b 0d 0d 2f |FERRLEN]|; .};../|
|00000650| 2a 20 54 46 54 50 20 6f | 70 63 6f 64 65 73 20 2a |* TFTP o|pcodes *|
|00000660| 2f 0d 23 64 65 66 69 6e | 65 09 52 52 51 09 09 31 |/.#defin|e.RRQ..1|
|00000670| 09 09 09 2f 2a 20 72 65 | 61 64 20 20 72 65 71 75 |.../* re|ad requ|
|00000680| 65 73 74 20 2a 2f 0d 23 | 64 65 66 69 6e 65 09 57 |est */.#|define.W|
|00000690| 52 51 09 09 32 09 09 09 | 2f 2a 20 77 72 69 74 65 |RQ..2...|/* write|
|000006a0| 20 72 65 71 75 65 73 74 | 20 2a 2f 0d 23 64 65 66 | request| */.#def|
|000006b0| 69 6e 65 09 44 41 54 41 | 09 33 09 09 09 2f 2a 20 |ine.DATA|.3.../* |
|000006c0| 64 61 74 61 20 70 61 63 | 6b 65 74 20 2a 2f 0d 23 |data pac|ket */.#|
|000006d0| 64 65 66 69 6e 65 09 41 | 43 4b 09 09 34 09 09 09 |define.A|CK..4...|
|000006e0| 2f 2a 20 61 63 6b 6e 6f | 77 6c 65 64 67 65 6d 65 |/* ackno|wledgeme|
|000006f0| 6e 74 20 70 61 63 6b 65 | 74 20 2a 2f 0d 23 64 65 |nt packe|t */.#de|
|00000700| 66 69 6e 65 09 45 52 52 | 4f 52 09 35 09 09 09 2f |fine.ERR|OR.5.../|
|00000710| 2a 20 65 72 72 6f 72 20 | 70 61 63 6b 65 74 20 2a |* error |packet *|
|00000720| 2f 0d 0d 2f 2a 20 54 46 | 54 50 20 65 72 72 6f 72 |/../* TF|TP error|
|00000730| 20 63 6f 64 65 73 20 2a | 2f 0d 23 64 65 66 69 6e | codes *|/.#defin|
|00000740| 65 09 45 52 52 54 58 54 | 09 09 30 09 09 2f 2a 20 |e.ERRTXT|..0../* |
|00000750| 73 65 65 20 74 68 65 20 | 65 6e 63 6c 6f 73 65 64 |see the |enclosed|
|00000760| 20 74 65 78 74 20 2a 2f | 0d 23 64 65 66 69 6e 65 | text */|.#define|
|00000770| 09 46 4e 4f 54 46 4f 55 | 4e 44 09 31 09 09 2f 2a |.FNOTFOU|ND.1../*|
|00000780| 20 66 69 6c 65 20 6e 6f | 74 20 66 6f 75 6e 64 20 | file no|t found |
|00000790| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 41 43 43 45 53 |*/.#defi|ne.ACCES|
|000007a0| 53 09 09 32 09 09 2f 2a | 20 61 63 63 65 73 73 20 |S..2../*| access |
|000007b0| 76 69 6f 6c 61 74 69 6f | 6e 20 2a 2f 0d 23 64 65 |violatio|n */.#de|
|000007c0| 66 69 6e 65 09 44 49 53 | 4b 46 55 4c 4c 09 33 09 |fine.DIS|KFULL.3.|
|000007d0| 09 2f 2a 20 64 6f 6e 27 | 74 20 65 76 65 6e 20 61 |./* don'|t even a|
|000007e0| 73 6b 2e 20 2a 2f 0d 23 | 64 65 66 69 6e 65 09 49 |sk. */.#|define.I|
|000007f0| 4c 4c 54 46 54 50 09 09 | 34 09 09 2f 2a 20 69 6c |LLTFTP..|4../* il|
|00000800| 6c 65 67 61 6c 20 54 46 | 54 50 20 6f 70 65 72 61 |legal TF|TP opera|
|00000810| 74 69 6f 6e 20 2a 2f 0d | 23 64 65 66 69 6e 65 09 |tion */.|#define.|
|00000820| 42 41 44 54 49 44 09 09 | 35 09 09 2f 2a 20 75 6e |BADTID..|5../* un|
|00000830| 6b 6f 77 6e 20 74 72 61 | 6e 73 66 65 72 20 49 44 |kown tra|nsfer ID|
|00000840| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 09 46 45 58 49 | */.#def|ine.FEXI|
|00000850| 53 54 53 09 09 36 09 09 | 2f 2a 20 66 69 6c 65 20 |STS..6..|/* file |
|00000860| 61 6c 72 65 61 64 79 20 | 65 78 69 73 74 73 20 2a |already |exists *|
|00000870| 2f 0d 23 64 65 66 69 6e | 65 09 4e 4f 55 53 45 52 |/.#defin|e.NOUSER|
|00000880| 09 09 37 09 09 2f 2a 20 | 6e 6f 20 73 75 63 68 20 |..7../* |no such |
|00000890| 75 73 65 72 20 2a 2f 0d | 0d 2f 2a 20 54 46 54 50 |user */.|./* TFTP|
|000008a0| 20 73 74 61 74 65 73 20 | 2a 2f 0d 23 64 65 66 69 | states |*/.#defi|
|000008b0| 6e 65 09 49 4e 49 54 09 | 09 30 0d 23 64 65 66 69 |ne.INIT.|.0.#defi|
|000008c0| 6e 65 09 44 41 54 41 57 | 41 49 54 09 31 0d 23 64 |ne.DATAW|AIT.1.#d|
|000008d0| 65 66 69 6e 65 09 41 43 | 4b 57 41 49 54 09 09 32 |efine.AC|KWAIT..2|
|000008e0| 0d 23 64 65 66 69 6e 65 | 09 44 45 41 44 09 09 33 |.#define|.DEAD..3|
|000008f0| 0d 23 64 65 66 69 6e 65 | 09 54 49 4d 45 4f 55 54 |.#define|.TIMEOUT|
|00000900| 09 09 34 0d 23 64 65 66 | 69 6e 65 09 52 43 56 45 |..4.#def|ine.RCVE|
|00000910| 52 52 09 09 35 0d 23 64 | 65 66 69 6e 65 09 52 43 |RR..5.#d|efine.RC|
|00000920| 56 41 43 4b 09 09 36 0d | 23 64 65 66 69 6e 65 09 |VACK..6.|#define.|
|00000930| 52 43 56 44 41 54 41 09 | 09 37 0d 23 64 65 66 69 |RCVDATA.|.7.#defi|
|00000940| 6e 65 09 52 43 56 4c 41 | 53 54 44 41 54 41 09 38 |ne.RCVLA|STDATA.8|
|00000950| 0d 23 64 65 66 69 6e 65 | 09 54 45 52 4d 49 4e 41 |.#define|.TERMINA|
|00000960| 54 45 44 09 39 0d 0d 23 | 64 65 66 69 6e 65 09 54 |TED.9..#|define.T|
|00000970| 46 54 50 53 4f 43 4b 09 | 36 39 09 2f 2a 20 54 46 |FTPSOCK.|69./* TF|
|00000980| 54 50 27 73 20 77 65 6c | 6c 20 6b 6e 6f 77 6e 20 |TP's wel|l known |
|00000990| 70 6f 72 74 20 2a 2f 0d | 23 64 65 66 69 6e 65 09 |port */.|#define.|
|000009a0| 54 46 54 50 54 52 49 45 | 53 09 32 30 09 2f 2a 20 |TFTPTRIE|S.20./* |
|000009b0| 23 20 6f 66 20 72 65 74 | 72 69 65 73 20 6f 6e 20 |# of ret|ries on |
|000009c0| 70 61 63 6b 65 74 20 74 | 72 61 6e 73 6d 69 73 73 |packet t|ransmiss|
|000009d0| 69 6f 6e 20 2a 2f 0d 23 | 64 65 66 69 6e 65 09 52 |ion */.#|define.R|
|000009e0| 45 51 54 52 49 45 53 09 | 34 09 2f 2a 20 23 20 6f |EQTRIES.|4./* # o|
|000009f0| 66 20 72 65 74 72 69 65 | 73 20 6f 6e 20 69 6e 69 |f retrie|s on ini|
|00000a00| 74 69 61 6c 20 72 65 71 | 75 65 73 74 20 2a 2f 0d |tial req|uest */.|
|00000a10| 23 64 65 66 69 6e 65 09 | 52 45 51 4c 45 4e 09 09 |#define.|REQLEN..|
|00000a20| 35 31 32 09 2f 2a 20 73 | 74 75 70 69 64 2c 20 73 |512./* s|tupid, s|
|00000a30| 74 75 70 69 64 2e 2e 2e | 20 2a 2f 0d 23 64 65 66 |tupid...| */.#def|
|00000a40| 69 6e 65 09 4e 4f 52 4d | 4c 45 4e 09 09 35 31 32 |ine.NORM|LEN..512|
|00000a50| 09 2f 2a 20 6e 6f 72 6d | 61 6c 20 6c 65 6e 67 74 |./* norm|al lengt|
|00000a60| 68 20 6f 66 20 72 65 63 | 65 69 76 65 64 20 70 61 |h of rec|eived pa|
|00000a70| 63 6b 65 74 20 2a 2f 0d | 0d 23 64 65 66 69 6e 65 |cket */.|.#define|
|00000a80| 20 4d 41 43 55 44 50 4c | 45 4e 09 32 30 34 38 09 | MACUDPL|EN.2048.|
|00000a90| 2f 2a 20 6d 69 6e 69 6d | 75 6d 20 55 44 50 20 62 |/* minim|um UDP b|
|00000aa0| 75 66 66 65 72 20 66 6f | 72 20 4d 61 63 54 43 50 |uffer fo|r MacTCP|
|00000ab0| 20 2a 2f 0d 0d 23 64 65 | 66 69 6e 65 09 74 66 74 | */..#de|fine.tft|
|00000ac0| 70 5f 64 61 74 61 28 70 | 29 09 28 28 73 74 72 75 |p_data(p|).((stru|
|00000ad0| 63 74 20 74 66 64 61 74 | 61 20 2a 29 28 28 70 29 |ct tfdat|a *)((p)|
|00000ae0| 29 29 2d 3e 74 66 5f 64 | 61 74 61 0d 0d 2f 2a 20 |))->tf_d|ata../* |
|00000af0| 54 68 65 20 54 46 54 50 | 20 63 6f 6e 6e 65 63 74 |The TFTP| connect|
|00000b00| 69 6f 6e 20 73 74 72 75 | 63 74 75 72 65 2e 20 43 |ion stru|cture. C|
|00000b10| 6f 6e 74 61 69 6e 73 20 | 63 6f 6e 6e 65 63 74 69 |ontains |connecti|
|00000b20| 6f 6e 20 69 6e 66 6f 2c | 20 61 6e 64 20 64 61 74 |on info,| and dat|
|00000b30| 61 20 66 6f 72 0d 09 74 | 69 6d 65 6f 75 74 20 63 |a for..t|imeout c|
|00000b40| 61 6c 63 75 6c 61 74 69 | 6f 6e 73 2e 20 2a 2f 0d |alculati|ons. */.|
|00000b50| 0d 73 74 72 75 63 74 20 | 74 66 63 6f 6e 6e 20 7b |.struct |tfconn {|
|00000b60| 0d 09 55 44 50 69 6f 70 | 62 09 09 2a 74 66 5f 75 |..UDPiop|b..*tf_u|
|00000b70| 64 70 3b 09 2f 2a 20 75 | 64 70 20 63 6f 6e 74 72 |dp;./* u|dp contr|
|00000b80| 6f 6c 20 62 6c 6f 63 6b | 20 66 6f 72 20 74 68 69 |ol block| for thi|
|00000b90| 73 20 74 72 61 6e 73 66 | 65 72 20 2a 2f 0d 09 46 |s transf|er */..F|
|00000ba0| 49 4c 45 09 09 2a 74 66 | 5f 66 64 3b 09 09 2f 2a |ILE..*tf|_fd;../*|
|00000bb0| 20 66 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 | file de|scriptor|
|00000bc0| 20 66 6f 72 20 78 66 65 | 72 20 2a 2f 0d 09 63 68 | for xfe|r */..ch|
|00000bd0| 61 72 20 2a 09 09 74 66 | 5f 6f 75 74 70 3b 09 2f |ar *..tf|_outp;./|
|00000be0| 2a 20 6c 61 73 74 20 73 | 65 6e 74 20 70 61 63 6b |* last s|ent pack|
|00000bf0| 65 74 20 2a 2f 0d 09 75 | 6e 73 69 67 6e 65 64 09 |et */..u|nsigned.|
|00000c00| 74 66 5f 6c 61 73 74 6c | 65 6e 3b 09 2f 2a 20 6c |tf_lastl|en;./* l|
|00000c10| 65 6e 67 74 68 20 6f 66 | 20 6c 61 73 74 20 73 65 |ength of| last se|
|00000c20| 6e 74 20 70 6b 74 20 2a | 2f 0d 09 75 6e 73 69 67 |nt pkt *|/..unsig|
|00000c30| 6e 65 64 09 74 66 5f 65 | 78 70 65 63 74 65 64 3b |ned.tf_e|xpected;|
|00000c40| 09 2f 2a 20 6d 6f 73 74 | 20 72 65 63 65 6e 74 6c |./* most| recentl|
|00000c50| 79 20 70 72 6f 63 65 73 | 73 65 64 20 62 6c 6f 63 |y proces|sed bloc|
|00000c60| 6b 20 2a 2f 0d 09 69 70 | 5f 61 64 64 72 09 09 74 |k */..ip|_addr..t|
|00000c70| 66 5f 68 6f 73 74 3b 09 | 2f 2a 20 68 6f 73 74 20 |f_host;.|/* host |
|00000c80| 61 64 64 72 65 73 73 20 | 2a 2f 0d 09 75 6e 73 69 |address |*/..unsi|
|00000c90| 67 6e 65 64 20 73 68 6f | 72 74 20 74 66 5f 70 6f |gned sho|rt tf_po|
|00000ca0| 72 74 3b 09 09 2f 2a 20 | 68 6f 73 74 20 70 6f 72 |rt;../* |host por|
|00000cb0| 74 20 23 20 2a 2f 0d 09 | 75 6e 73 69 67 6e 65 64 |t # */..|unsigned|
|00000cc0| 09 74 66 5f 68 61 76 65 | 70 6f 72 74 3b 09 2f 2a |.tf_have|port;./*|
|00000cd0| 20 77 65 27 76 65 20 67 | 6f 74 20 74 68 65 20 66 | we've g|ot the f|
|00000ce0| 6f 72 65 69 67 6e 20 70 | 6f 72 74 20 2a 2f 0d 09 |oreign p|ort */..|
|00000cf0| 74 69 6d 65 72 09 09 2a | 74 66 5f 74 6d 3b 09 09 |timer..*|tf_tm;..|
|00000d00| 2f 2a 20 6f 75 72 20 74 | 69 6d 65 72 20 2a 2f 0d |/* our t|imer */.|
|00000d10| 09 75 6e 73 69 67 6e 65 | 64 09 74 66 5f 73 74 61 |.unsigne|d.tf_sta|
|00000d20| 74 65 3b 09 2f 2a 20 73 | 74 61 74 65 20 6f 66 20 |te;./* s|tate of |
|00000d30| 63 6f 6e 6e 65 63 74 69 | 6f 6e 20 2a 2f 0d 09 75 |connecti|on */..u|
|00000d40| 6e 73 69 67 6e 65 64 09 | 74 66 5f 74 72 69 65 73 |nsigned.|tf_tries|
|00000d50| 3b 09 2f 2a 20 23 20 6f | 66 20 72 65 74 72 69 65 |;./* # o|f retrie|
|00000d60| 73 20 61 6c 72 65 61 64 | 79 20 64 6f 6e 65 20 2a |s alread|y done *|
|00000d70| 2f 0d 09 75 6e 73 69 67 | 6e 65 64 09 74 66 5f 6d |/..unsig|ned.tf_m|
|00000d80| 6f 64 65 3b 09 2f 2a 20 | 6d 6f 64 65 20 3d 20 49 |ode;./* |mode = I|
|00000d90| 4d 41 47 45 2c 20 5b 6e | 65 74 5d 41 53 43 49 49 |MAGE, [n|et]ASCII|
|00000da0| 2c 20 2e 2e 2e 20 2a 2f | 0d 09 75 6e 73 69 67 6e |, ... */|..unsign|
|00000db0| 65 64 09 74 66 5f 64 69 | 72 3b 09 09 2f 2a 20 64 |ed.tf_di|r;../* d|
|00000dc0| 69 72 65 63 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |irection| of the |
|00000dd0| 74 72 61 6e 73 66 65 72 | 20 2a 2f 0d 09 6c 6f 6e |transfer| */..lon|
|00000de0| 67 09 09 74 66 5f 73 69 | 7a 65 3b 09 2f 2a 20 23 |g..tf_si|ze;./* #|
|00000df0| 20 6f 66 20 62 79 74 65 | 73 20 74 72 61 6e 73 66 | of byte|s transf|
|00000e00| 65 72 72 65 64 20 2a 2f | 0d 09 75 6e 73 69 67 6e |erred */|..unsign|
|00000e10| 65 64 09 74 66 5f 72 63 | 76 3b 09 09 2f 2a 20 23 |ed.tf_rc|v;../* #|
|00000e20| 20 6f 66 20 70 61 63 6b | 65 74 73 20 72 65 63 65 | of pack|ets rece|
|00000e30| 69 76 65 64 20 2a 2f 0d | 09 75 6e 73 69 67 6e 65 |ived */.|.unsigne|
|00000e40| 64 09 74 66 5f 73 6e 74 | 3b 09 09 2f 2a 20 23 20 |d.tf_snt|;../* # |
|00000e50| 6f 66 20 70 61 63 6b 65 | 74 73 20 73 65 6e 74 20 |of packe|ts sent |
|00000e60| 2a 2f 0d 09 75 6e 73 69 | 67 6e 65 64 09 74 66 5f |*/..unsi|gned.tf_|
|00000e70| 6f 75 73 3b 09 09 2f 2a | 20 23 20 6f 66 20 6f 75 |ous;../*| # of ou|
|00000e80| 74 20 6f 66 20 73 65 71 | 75 65 6e 63 65 20 70 61 |t of seq|uence pa|
|00000e90| 63 6b 65 74 73 20 2a 2f | 0d 09 75 6e 73 69 67 6e |ckets */|..unsign|
|00000ea0| 65 64 09 74 66 5f 6e 74 | 6d 6f 3b 09 2f 2a 20 23 |ed.tf_nt|mo;./* #|
|00000eb0| 20 6f 66 20 74 69 6d 65 | 6f 75 74 73 20 2a 2f 0d | of time|outs */.|
|00000ec0| 09 75 6e 73 69 67 6e 65 | 64 09 74 66 5f 72 73 6e |.unsigne|d.tf_rsn|
|00000ed0| 64 3b 09 2f 2a 20 23 20 | 6f 66 20 72 65 73 65 6e |d;./* # |of resen|
|00000ee0| 64 73 20 2a 2f 0d 09 6c | 6f 6e 67 09 09 74 66 5f |ds */..l|ong..tf_|
|00000ef0| 74 72 74 3b 09 09 2f 2a | 20 72 6f 75 6e 64 20 74 |trt;../*| round t|
|00000f00| 72 69 70 20 74 69 6d 65 | 20 2a 2f 0d 09 6c 6f 6e |rip time| */..lon|
|00000f10| 67 09 09 74 66 5f 72 74 | 3b 09 09 2f 2a 20 63 75 |g..tf_rt|;../* cu|
|00000f20| 72 72 65 6e 74 20 74 69 | 6d 65 6f 75 74 20 2a 2f |rrent ti|meout */|
|00000f30| 0d 09 69 6e 74 09 09 09 | 74 66 5f 4e 52 3b 09 09 |..int...|tf_NR;..|
|00000f40| 2f 2a 20 6e 75 6d 62 65 | 72 20 72 65 78 6d 69 73 |/* numbe|r rexmis|
|00000f50| 73 69 6f 6e 73 20 6f 66 | 20 74 68 69 73 20 70 6b |sions of| this pk|
|00000f60| 74 20 2a 2f 0d 09 69 6e | 74 09 09 09 74 66 5f 4e |t */..in|t...tf_N|
|00000f70| 52 5f 6c 61 73 74 3b 09 | 2f 2a 20 22 09 22 09 22 |R_last;.|/* "."."|
|00000f80| 20 6f 66 20 70 72 65 76 | 20 70 6b 74 20 2a 2f 0d | of prev| pkt */.|
|00000f90| 09 69 6e 74 09 09 09 74 | 66 5f 4b 3b 09 09 2f 2a |.int...t|f_K;../*|
|00000fa0| 20 74 75 6e 69 6e 67 20 | 63 6f 6e 73 74 61 6e 74 | tuning |constant|
|00000fb0| 20 2a 2f 0d 09 6c 6f 6e | 67 09 09 74 66 5f 73 65 | */..lon|g..tf_se|
|00000fc0| 6e 74 3b 09 2f 2a 20 74 | 69 6d 65 20 74 68 61 74 |nt;./* t|ime that|
|00000fd0| 20 70 6b 74 20 77 61 73 | 20 73 65 6e 74 20 2a 2f | pkt was| sent */|
|00000fe0| 0d 09 53 74 72 65 61 6d | 50 74 72 09 73 74 72 65 |..Stream|Ptr.stre|
|00000ff0| 61 6d 3b 09 09 2f 2a 20 | 74 68 65 20 4d 61 63 54 |am;../* |the MacT|
|00001000| 43 50 20 75 64 70 20 73 | 74 72 65 61 6d 20 2a 20 |CP udp s|tream * |
|00001010| 2a 2f 0d 7d 3b 0d 0d 2f | 2a 20 20 43 6f 6e 73 74 |*/.};../|* Const|
|00001020| 61 6e 74 73 20 66 6f 72 | 20 72 6f 75 6e 64 20 74 |ants for| round t|
|00001030| 72 69 70 20 74 69 6d 65 | 20 65 73 74 69 6d 61 74 |rip time| estimat|
|00001040| 69 6f 6e 20 61 6e 64 20 | 72 65 74 72 79 20 74 69 |ion and |retry ti|
|00001050| 6d 65 6f 75 74 2e 0d 20 | 20 20 20 41 6c 6c 20 63 |meout.. | All c|
|00001060| 61 6c 63 75 6c 61 74 69 | 6f 6e 20 69 73 20 64 6f |alculati|on is do|
|00001070| 6e 65 20 69 6e 20 63 6c | 6f 63 6b 20 74 69 63 6b |ne in cl|ock tick|
|00001080| 73 20 28 61 74 20 61 20 | 72 61 74 65 20 6f 66 20 |s (at a |rate of |
|00001090| 31 38 2f 73 65 63 6f 6e | 64 29 20 62 75 74 0d 20 |18/secon|d) but. |
|000010a0| 20 20 20 6f 6e 6c 79 20 | 74 68 65 20 69 6e 69 74 | only |the init|
|000010b0| 69 61 6c 20 65 73 74 69 | 6d 61 74 65 20 61 6e 64 |ial esti|mate and|
|000010c0| 20 74 68 65 20 75 70 70 | 65 72 20 6c 69 6d 69 74 | the upp|er limit|
|000010d0| 20 61 72 65 20 73 70 65 | 63 69 66 69 65 64 20 69 | are spe|cified i|
|000010e0| 6e 20 74 69 63 6b 73 3b | 0d 20 20 20 20 74 68 65 |n ticks;|. the|
|000010f0| 20 72 65 73 74 20 6f 66 | 20 74 68 65 20 61 6c 67 | rest of| the alg|
|00001100| 6f 72 69 74 68 6d 20 75 | 73 65 73 20 64 69 6d 65 |orithm u|ses dime|
|00001110| 6e 73 69 6f 6e 6c 65 73 | 73 20 6d 75 6c 74 69 70 |nsionles|s multip|
|00001120| 6c 69 65 72 73 2e 20 20 | 2a 2f 0d 0d 23 64 65 66 |liers. |*/..#def|
|00001130| 69 6e 65 09 4b 69 6e 69 | 74 09 33 09 2f 2a 20 49 |ine.Kini|t.3./* I|
|00001140| 6e 69 74 69 61 6c 20 64 | 69 76 69 73 6f 72 20 66 |nitial d|ivisor f|
|00001150| 6f 72 20 28 31 2b 31 2f | 4b 29 20 65 73 74 69 6d |or (1+1/|K) estim|
|00001160| 61 74 65 20 6d 75 6c 74 | 69 70 6c 69 65 72 2e 20 |ate mult|iplier. |
|00001170| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 4b 69 6e 63 09 |*/.#defi|ne.Kinc.|
|00001180| 31 09 2f 2a 20 52 65 64 | 75 63 65 20 4b 20 62 79 |1./* Red|uce K by|
|00001190| 20 74 68 69 73 20 69 66 | 20 70 72 65 76 69 6f 75 | this if| previou|
|000011a0| 73 20 70 61 63 6b 65 74 | 20 6c 6f 73 74 2e 20 20 |s packet| lost. |
|000011b0| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 54 30 09 09 31 |*/.#defi|ne.T0..1|
|000011c0| 38 30 09 2f 2a 20 32 2e | 35 20 73 65 63 73 20 49 |80./* 2.|5 secs I|
|000011d0| 6e 69 74 69 61 6c 20 76 | 61 6c 75 65 20 66 6f 72 |nitial v|alue for|
|000011e0| 20 72 6f 75 6e 64 20 74 | 72 69 70 20 74 69 6d 65 | round t|rip time|
|000011f0| 20 65 73 74 69 6d 61 74 | 65 2e 20 20 2a 2f 0d 23 | estimat|e. */.#|
|00001200| 64 65 66 69 6e 65 09 4d | 41 58 54 4d 4f 09 37 32 |define.M|AXTMO.72|
|00001210| 30 09 2f 2a 20 31 32 20 | 73 65 63 2e 20 75 70 70 |0./* 12 |sec. upp|
|00001220| 65 72 20 6c 69 6d 69 74 | 20 6f 6e 20 72 65 74 72 |er limit| on retr|
|00001230| 79 20 74 69 6d 65 6f 75 | 74 20 74 69 6d 65 72 2c |y timeou|t timer,|
|00001240| 20 69 6e 20 74 69 63 6b | 73 2e 20 20 2a 2f 0d 23 | in tick|s. */.#|
|00001250| 64 65 66 69 6e 65 09 54 | 4d 4d 55 4c 54 20 20 33 |define.T|MMULT 3|
|00001260| 09 2f 2a 20 6d 75 6c 74 | 69 70 6c 69 65 72 20 74 |./* mult|iplier t|
|00001270| 6f 20 67 65 74 20 72 65 | 74 72 79 20 74 69 6d 65 |o get re|try time|
|00001280| 6f 75 74 20 66 72 6f 6d | 20 72 6f 75 6e 64 20 74 |out from| round t|
|00001290| 72 69 70 0d 09 09 09 20 | 20 20 65 73 74 69 6d 61 |rip.... | estima|
|000012a0| 74 65 2e 20 20 2a 2f 0d | 0d 2f 2a 20 54 46 54 50 |te. */.|./* TFTP|
|000012b0| 20 72 61 6e 64 6f 6d 73 | 20 2a 2f 0d 23 64 65 66 | randoms| */.#def|
|000012c0| 69 6e 65 09 47 45 54 09 | 31 30 09 09 2f 2a 20 47 |ine.GET.|10../* G|
|000012d0| 45 54 20 66 69 6c 65 20 | 66 72 6f 6d 20 6f 74 68 |ET file |from oth|
|000012e0| 65 72 20 68 6f 73 74 20 | 74 6f 20 68 65 72 65 20 |er host |to here |
|000012f0| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 50 55 54 09 31 |*/.#defi|ne.PUT.1|
|00001300| 31 09 09 2f 2a 20 50 55 | 54 20 66 69 6c 65 20 6f |1../* PU|T file o|
|00001310| 6e 20 6f 74 68 65 72 20 | 68 6f 73 74 20 2a 2f 0d |n other |host */.|
|00001320| 23 64 65 66 69 6e 65 09 | 41 53 43 49 49 09 31 09 |#define.|ASCII.1.|
|00001330| 09 2f 2a 20 74 72 61 6e | 73 66 65 72 20 61 73 20 |./* tran|sfer as |
|00001340| 6e 65 74 61 73 63 69 69 | 20 2a 2f 0d 23 64 65 66 |netascii| */.#def|
|00001350| 69 6e 65 09 49 4d 41 47 | 45 09 32 09 09 2f 2a 20 |ine.IMAG|E.2../* |
|00001360| 74 72 61 6e 73 66 65 72 | 20 61 73 20 69 6d 61 67 |transfer| as imag|
|00001370| 65 20 2a 2f 0d 23 64 65 | 66 69 6e 65 09 54 45 53 |e */.#de|fine.TES|
|00001380| 54 09 33 09 09 2f 2a 20 | 74 65 73 74 20 6d 6f 64 |T.3../* |test mod|
|00001390| 65 20 2d 20 64 69 73 6b | 6c 65 73 73 20 2a 2f 0d |e - disk|less */.|
|000013a0| 23 64 65 66 69 6e 65 09 | 4f 43 54 45 54 09 34 09 |#define.|OCTET.4.|
|000013b0| 09 2f 2a 20 6f 63 74 65 | 74 20 6d 6f 64 65 20 2d |./* octe|t mode -|
|000013c0| 20 73 61 6d 65 20 61 73 | 20 69 6d 61 67 65 20 2a | same as| image *|
|000013d0| 2f 0d 0d 69 6e 74 20 6d | 74 63 70 5f 74 66 74 70 |/..int m|tcp_tftp|
|000013e0| 72 63 76 28 29 3b 09 09 | 2f 2a 20 70 61 63 6b 65 |rcv();..|/* packe|
|000013f0| 74 20 72 65 63 65 69 76 | 65 20 72 6f 75 74 69 6e |t receiv|e routin|
|00001400| 65 20 2a 2f 0d 69 6e 74 | 20 6d 74 63 70 5f 74 66 |e */.int| mtcp_tf|
|00001410| 74 70 74 6d 6f 28 29 3b | 09 09 2f 2a 20 74 69 6d |tptmo();|../* tim|
|00001420| 65 6f 75 74 20 68 61 6e | 64 6c 65 72 20 2a 2f 0d |eout han|dler */.|
|00001430| 6c 6f 6e 67 20 6d 74 63 | 70 5f 74 66 63 6c 65 61 |long mtc|p_tfclea|
|00001440| 6e 75 70 28 29 3b 0d 6c | 6f 6e 67 20 74 66 74 70 |nup();.l|ong tftp|
|00001450| 75 73 65 28 29 3b 0d 6c | 6f 6e 67 20 61 74 6f 6c |use();.l|ong atol|
|00001460| 28 29 3b 0d 0d 70 61 73 | 63 61 6c 20 76 6f 69 64 |();..pas|cal void|
|00001470| 20 75 64 70 5f 65 76 65 | 6e 74 28 29 3b 0d 0d 65 | udp_eve|nt();..e|
|00001480| 78 74 65 72 6e 20 63 68 | 61 72 20 2a 74 66 74 70 |xtern ch|ar *tftp|
|00001490| 6c 6f 67 3b 0d 65 78 74 | 65 72 6e 20 75 6e 73 69 |log;.ext|ern unsi|
|000014a0| 67 6e 65 64 20 6c 6f 6e | 67 20 63 74 69 63 6b 73 |gned lon|g cticks|
|000014b0| 3b 0d 65 78 74 65 72 6e | 20 69 6e 74 20 6e 74 66 |;.extern| int ntf|
|000014c0| 74 70 73 3b 0d 0d 65 78 | 74 65 72 6e 20 69 6e 74 |tps;..ex|tern int|
|000014d0| 20 74 66 73 64 61 74 61 | 3b 0d 65 78 74 65 72 6e | tfsdata|;.extern|
|000014e0| 20 69 6e 74 20 74 66 74 | 70 64 61 74 61 3b 0d 0d | int tft|pdata;..|
|000014f0| 65 78 74 65 72 6e 20 73 | 68 6f 72 74 20 69 70 70 |extern s|hort ipp|
|00001500| 5f 72 65 66 6e 75 6d 3b | 09 2f 2a 20 66 72 6f 6d |_refnum;|./* from|
|00001510| 20 74 63 70 2e 63 20 2a | 2f 0d 65 78 74 65 72 6e | tcp.c *|/.extern|
|00001520| 20 69 6e 74 20 63 6c 6f | 73 65 66 6c 61 67 3b 09 | int clo|seflag;.|
|00001530| 09 2f 2a 20 66 72 6f 6d | 20 74 63 70 2e 63 20 2a |./* from| tcp.c *|
|00001540| 2f 0d 0d 65 78 74 65 72 | 6e 20 55 44 50 69 6f 70 |/..exter|n UDPiop|
|00001550| 62 20 74 66 73 70 62 3b | 0d 65 78 74 65 72 6e 20 |b tfspb;|.extern |
|00001560| 55 44 50 69 6f 70 62 20 | 74 66 74 70 70 62 3b 0d |UDPiopb |tftppb;.|
|00001570| 0d 65 78 74 65 72 6e 20 | 69 6e 74 20 74 66 73 5f |.extern |int tfs_|
|00001580| 72 65 61 64 5f 72 65 71 | 3b 0d 65 78 74 65 72 6e |read_req|;.extern|
|00001590| 20 69 6e 74 20 74 66 73 | 5f 72 65 61 64 5f 63 6f | int tfs|_read_co|
|000015a0| 6d 70 3b 0d 65 78 74 65 | 72 6e 20 69 6e 74 20 74 |mp;.exte|rn int t|
|000015b0| 66 74 70 5f 72 65 61 64 | 5f 72 65 71 3b 0d 65 78 |ftp_read|_req;.ex|
|000015c0| 74 65 72 6e 20 69 6e 74 | 20 74 66 74 70 5f 72 65 |tern int| tftp_re|
|000015d0| 61 64 5f 63 6f 6d 70 3b | 0d 0d 76 6f 69 64 20 74 |ad_comp;|..void t|
|000015e0| 66 73 5f 72 65 61 64 5f | 64 6f 6e 65 28 29 3b 0d |fs_read_|done();.|
|000015f0| 76 6f 69 64 20 74 66 74 | 70 5f 72 65 61 64 5f 64 |void tft|p_read_d|
|00001600| 6f 6e 65 28 29 3b 0d 0d | 65 78 74 65 72 6e 20 73 |one();..|extern s|
|00001610| 74 72 75 63 74 20 74 66 | 63 6f 6e 6e 20 74 66 73 |truct tf|conn tfs|
|00001620| 63 6f 6e 6e 3b 0d 65 78 | 74 65 72 6e 20 73 74 72 |conn;.ex|tern str|
|00001630| 75 63 74 20 74 66 63 6f | 6e 6e 20 74 66 74 70 63 |uct tfco|nn tftpc|
|00001640| 6f 6e 6e 3b 0d 0d 23 64 | 65 66 69 6e 65 20 6d 69 |onn;..#d|efine mi|
|00001650| 6e 28 78 2c 79 29 09 28 | 28 78 29 20 3c 20 28 79 |n(x,y).(|(x) < (y|
|00001660| 29 20 3f 20 28 78 29 20 | 3a 20 28 79 29 29 0d 23 |) ? (x) |: (y)).#|
|00001670| 64 65 66 69 6e 65 20 6d | 61 78 28 78 2c 79 29 09 |define m|ax(x,y).|
|00001680| 28 28 78 29 20 3e 20 28 | 79 29 20 3f 20 28 78 29 |((x) > (|y) ? (x)|
|00001690| 20 3a 20 28 79 29 29 0d | 0d 2f 2a 20 74 68 65 20 | : (y)).|./* the |
|000016a0| 66 6f 6c 6c 6f 77 69 6e | 67 20 61 72 65 20 74 72 |followin|g are tr|
|000016b0| 61 63 65 20 64 65 66 69 | 6e 65 73 2c 20 6d 6f 73 |ace defi|nes, mos|
|000016c0| 74 6c 79 20 75 6e 75 73 | 65 64 20 2a 2f 0d 0d 23 |tly unus|ed */..#|
|000016d0| 64 65 66 69 6e 65 09 42 | 55 47 48 41 4c 54 09 09 |define.B|UGHALT..|
|000016e0| 31 09 2f 2a 20 42 55 47 | 48 41 4c 54 20 6f 6e 20 |1./* BUG|HALT on |
|000016f0| 61 20 67 72 6f 73 73 20 | 61 70 70 6c 69 63 61 74 |a gross |applicat|
|00001700| 69 6f 6e 73 20 6c 65 76 | 65 6c 20 65 72 72 6f 72 |ions lev|el error|
|00001710| 0d 09 09 09 09 09 74 68 | 61 74 20 69 73 20 64 65 |......th|at is de|
|00001720| 74 65 63 74 65 64 20 69 | 6e 20 74 68 65 20 6e 65 |tected i|n the ne|
|00001730| 74 77 6f 72 6b 20 63 6f | 64 65 20 2a 2f 0d 23 64 |twork co|de */.#d|
|00001740| 65 66 69 6e 65 09 44 55 | 4d 50 09 09 32 09 2f 2a |efine.DU|MP..2./*|
|00001750| 20 44 6f 20 61 20 64 75 | 6d 70 20 6f 66 20 61 6c | Do a du|mp of al|
|00001760| 6c 20 62 61 64 20 69 6e | 63 6f 6d 69 6e 67 20 70 |l bad in|coming p|
|00001770| 61 63 6b 65 74 73 20 2a | 2f 0d 23 64 65 66 69 6e |ackets *|/.#defin|
|00001780| 65 09 49 4e 46 4f 4d 53 | 47 09 09 34 09 2f 2a 20 |e.INFOMS|G..4./* |
|00001790| 50 72 69 6e 74 20 69 6e | 66 6f 72 6d 61 74 69 6f |Print in|formatio|
|000017a0| 6e 61 6c 20 6d 65 73 73 | 61 67 65 73 20 73 75 63 |nal mess|ages suc|
|000017b0| 68 20 61 73 20 70 61 63 | 6b 65 74 0d 09 09 09 09 |h as pac|ket.....|
|000017c0| 09 72 65 63 65 69 76 65 | 64 2c 20 65 74 63 2e 20 |.receive|d, etc. |
|000017d0| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 4e 45 54 45 52 |*/.#defi|ne.NETER|
|000017e0| 52 09 09 38 09 2f 2a 20 | 44 69 73 70 6c 61 79 20 |R..8./* |Display |
|000017f0| 6e 65 74 20 69 6e 74 65 | 72 66 61 63 65 20 65 72 |net inte|rface er|
|00001800| 72 6f 72 20 6d 65 73 73 | 61 67 65 73 20 2a 2f 0d |ror mess|ages */.|
|00001810| 23 64 65 66 69 6e 65 09 | 50 52 4f 54 45 52 52 09 |#define.|PROTERR.|
|00001820| 09 31 36 09 2f 2a 20 44 | 69 73 70 6c 61 79 20 70 |.16./* D|isplay p|
|00001830| 72 6f 74 6f 63 6f 6c 20 | 6c 65 76 65 6c 20 65 72 |rotocol |level er|
|00001840| 72 6f 72 20 6d 65 73 73 | 61 67 65 73 20 2a 2f 0d |ror mess|ages */.|
|00001850| 23 64 65 66 69 6e 65 09 | 54 52 41 43 45 09 09 33 |#define.|TRACE..3|
|00001860| 32 09 2f 2a 20 54 72 61 | 63 65 20 70 61 63 6b 65 |2./* Tra|ce packe|
|00001870| 74 20 74 68 72 6f 75 67 | 68 20 70 72 6f 74 6f 63 |t throug|h protoc|
|00001880| 6f 6c 20 6c 61 79 65 72 | 73 20 2a 2f 0d 23 64 65 |ol layer|s */.#de|
|00001890| 66 69 6e 65 20 4e 45 54 | 52 41 43 45 09 09 33 32 |fine NET|RACE..32|
|000018a0| 09 2f 2a 20 54 72 61 63 | 65 20 70 61 63 6b 65 74 |./* Trac|e packet|
|000018b0| 20 69 6e 20 6c 69 6e 6b | 20 6c 65 76 65 6c 20 6e | in link| level n|
|000018c0| 65 74 20 6c 61 79 65 72 | 20 2a 2f 0d 23 64 65 66 |et layer| */.#def|
|000018d0| 69 6e 65 20 49 4e 54 52 | 41 43 45 09 09 33 32 09 |ine INTR|ACE..32.|
|000018e0| 2f 2a 20 54 72 61 63 65 | 20 70 61 63 6b 65 74 20 |/* Trace| packet |
|000018f0| 69 6e 20 69 6e 74 65 72 | 6e 65 74 20 6c 61 79 65 |in inter|net laye|
|00001900| 72 20 20 2a 2f 0d 23 64 | 65 66 69 6e 65 20 54 43 |r */.#d|efine TC|
|00001910| 54 52 41 43 45 09 09 33 | 32 09 2f 2a 20 54 72 61 |TRACE..3|2./* Tra|
|00001920| 6e 73 6d 69 73 73 69 6f | 6e 20 63 6f 6e 74 72 6f |nsmissio|n contro|
|00001930| 6c 20 28 55 44 50 2c 20 | 54 43 50 29 20 74 72 61 |l (UDP, |TCP) tra|
|00001940| 63 65 20 2a 2f 0d 23 64 | 65 66 69 6e 65 20 41 50 |ce */.#d|efine AP|
|00001950| 54 52 41 43 45 09 09 31 | 32 38 09 2f 2a 20 54 72 |TRACE..1|28./* Tr|
|00001960| 61 63 65 20 70 61 63 6b | 65 74 20 74 68 72 6f 75 |ace pack|et throu|
|00001970| 67 68 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 2a |gh appli|cation *|
|00001980| 2f 0d 23 64 65 66 69 6e | 65 09 54 4d 4f 09 09 09 |/.#defin|e.TMO...|
|00001990| 20 36 34 09 2f 2a 20 50 | 72 69 6e 74 20 6d 65 73 | 64./* P|rint mes|
|000019a0| 73 61 67 65 20 6f 6e 20 | 74 69 6d 65 6f 75 74 20 |sage on |timeout |
|000019b0| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 52 4f 55 54 45 |*/.#defi|ne.ROUTE|
|000019c0| 09 09 31 32 38 09 2f 2a | 20 74 75 72 6e 20 6f 6e |..128./*| turn on|
|000019d0| 20 72 6f 75 74 69 6e 67 | 20 74 72 61 63 69 6e 67 | routing| tracing|
|000019e0| 20 2a 2f 0d 23 64 65 66 | 69 6e 65 09 54 43 50 54 | */.#def|ine.TCPT|
|000019f0| 52 41 43 45 09 32 35 36 | 0d 0d 23 64 65 66 69 6e |RACE.256|..#defin|
|00001a00| 65 09 4f 46 46 09 30 0d | 23 64 65 66 69 6e 65 09 |e.OFF.0.|#define.|
|00001a10| 4f 4e 09 31 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |ON.1....|........|
|00001a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a80| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00001a90| 2a 2f 0d 23 64 65 66 69 | 6e 65 09 54 45 53 54 09 |*/.#defi|ne.TEST.|
|00001aa0| 33 09 09 2f 2a 20 74 65 | 73 74 20 6d 6f 64 65 20 |3../* te|st mode |
|00001ab0| 06 74 66 74 70 2e 68 b4 | 02 00 00 00 50 61 72 74 |.tftp.h.|....Part|
|00001ac0| 53 49 54 78 00 00 00 00 | 00 00 00 00 00 01 8b de |SITx....|........|
|00001ad0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 a9 8d 3a 73 00 00 | 00 00 00 00 01 7e 3b 09 |....:s..|.....~;.|
|00001b00| 09 2f 2a 20 70 61 63 6b | 65 74 20 72 65 63 65 69 |./* pack|et recei|
|00001b10| 76 65 20 72 6f 75 74 69 | 6e 65 20 2a 2f 0d 69 6e |ve routi|ne */.in|
|00001b20| 74 20 74 66 74 70 74 6d | 6f 28 29 3b 09 09 2f 2a |t tftptm|o();../*|
|00001b30| 20 74 69 6d 65 6f 75 74 | 20 68 61 6e 64 6c 65 72 | timeout| handler|
|00001b40| 20 2a 2f 0d 6c 6f 6e 67 | 20 74 66 63 6c 65 61 6e | */.long| tfclean|
|00001b50| 75 70 28 29 2c 20 74 66 | 74 70 75 73 65 28 29 2c |up(), tf|tpuse(),|
|00001b60| 20 61 74 6f 6c 28 29 3b | 0d 73 74 72 75 63 74 20 | atol();|.struct |
|00001b70| 74 66 63 6f 6e 6e 20 2a | 74 66 6d 6b 63 6e 28 29 |tfconn *|tfmkcn()|
|00001b80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 74 65 72 |...H..Mo|naco.ter|
|00001b90| 6e 20 69 6e 74 20 6e 74 | 66 74 70 73 3b 6d 61 6b |n int nt|ftps;mak|
|00001ba0| 82 00 00 14 00 01 00 06 | 00 04 00 27 00 00 01 e1 |........|...'....|
|00001bb0| 02 00 00 27 00 00 01 e1 | 02 00 a3 dc b8 d0 00 00 |...'....|........|
|00001bc0| 19 96 00 00 19 96 00 00 | 15 c5 01 00 00 00 01 00 |........|........|
|00001bd0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 1c 80 a0 |...L...L|...2....|
|00001be0| 0a 4a 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.J.....2|..MPSR..|
|00001bf0| 00 0a 03 ed ff ff 00 00 | 00 00 00 1d b5 70 00 00 |........|.....p..|
+--------+-------------------------+-------------------------+--------+--------+